import 'package:mall/core/models/product_detail.dart';
import 'package:json_annotation/json_annotation.dart';

part 'cart_list.g.dart';

@JsonSerializable()
class CartList {
  final List<Store> carts;

  CartList(this.carts);

  factory CartList.fromJson(Map<String, dynamic> json) => _$CartListFromJson(json);

  Map<String, dynamic> toJson() => _$CartListToJson(this);
}

@JsonSerializable()
class Store {
  final int storeId;
  final String storeName;
  final double freight;
  final List<Cart> cartList;
  final String message;

  Store(
    this.storeId,
    this.storeName,
    this.freight,
    this.cartList,
    this.message,
  );

  factory Store.fromJson(Map<String, dynamic> json) => _$StoreFromJson(json);

  Map<String, dynamic> toJson() => _$StoreToJson(this);
}

@JsonSerializable()
class Cart {
  final int cartId;
  final String productName;
  final String productImage;
  final int quantity;
  final List<Price> priceVos;

  Cart(this.cartId, this.productName, this.productImage, this.quantity, this.priceVos);

  factory Cart.fromJson(Map<String, dynamic> json) => _$CartFromJson(json);

  Map<String, dynamic> toJson() => _$CartToJson(this);
}
